package net.sky.oa.test.dao.addrbook;

import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.addrbook.AddMyaddrDao;
import net.sky.oa.model.AddMyaddr;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class AddMyaddrDaoTestCase extends BaseTestCase {

	@Resource
	private AddMyaddrDao addMyaddrDao;

	@Test
	@Rollback(false)
	public void add() {
		AddMyaddr addMyaddr = new AddMyaddr();
		addMyaddr.setName("addrName");
		addMyaddr.setMobile("13537720409");
		this.addMyaddrDao.save(addMyaddr);
	}

	@Test
	@Rollback(false)
	public void find() {

		List<AddMyaddr> myaddrs = this.addMyaddrDao.findAllMyaddr();
		for (AddMyaddr myaddr : myaddrs) {
			System.out.println("getName:" + myaddr.getName());
		}
	}
}